fix(eth_sendRawTransaction): return InvalidParams for malformed RLP - #12003
fix(eth_sendRawTransaction): return InvalidParams for malformed RLP#12003manusw7 wants to merge 4 commits into
Conversation
… RLP and enhance error messages
…endRawTransaction tests
|
Claude finished @manusw7's task in 2m 45s —— View job PR Review: fix(eth_sendRawTransaction): return InvalidParams for malformed RLP
SummaryThis is a correct, well-scoped fix. The change aligns Nethermind with JSON-RPC 2.0 semantics: parameter-decoding failures belong at Two low-severity nits are noted below; neither blocks merge. FindingsLow — String concatenation instead of interpolation
Low — SetCode null-address test asserts code only, not message
Positive observations
|
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
@manusw7 ready for review? |
we should wait for an update from geth before proceeding (see here ethereum/go-ethereum#35129) |
Closes #11921
Changes
RlpExceptionthrown byeth_sendRawTransaction/eth_sendRawTransactionSyncto-32602(InvalidParams) instead of-32000(InvalidInput)."Invalid RLP: " + e.Message, replacing the opaque"Invalid RLP."literal so callers can tell why the payload was rejected (empty list, truncated, unknown type, EIP-4844/7702 short list, etc.).Send_raw_transaction_returns_invalid_params_for_malformed_rlpover the 5 decode-failure shapes from the issue (0xc0,0xd4,0x09c0,0x03c0,0x04c0); updateSendRawTransactionSyncFailureCasesand the SetCode-authorization regression test to assert the new code.Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
13 fixtures in rpc-tests#11 (
test_01-06, 12-16, 20, 21) currently FAIL against Nethermind and flip to PASS with this change.Documentation
Requires documentation update
Requires explanation in Release Notes
Remarks
The
-32000returned today is a fallback accident, not a deliberate choice — RLP decode errors don't carry a JSON-RPC code, so the dispatcher defaults to-32000. Per JSON-RPC 2.0, parameter-validation failures should be-32602. Reth and Besu already do this; this change aligns Nethermind.Companion PRs taking the same axis to the other major clients: